var t = o(require("@vant/weapp/toast/toast")), e = o(require("@vant/weapp/dialog/dialog"));

function o(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}

var n = getApp(),  a = require("../../utils/request"), s = require("../../utils/storage"),config = require("../../utils/config");

Page({
    data: {
        themeColor: n.globalData.themeColor,
        showLogOutButton: !1,
        
    },
    onLoad: function(t) {
        console.log('geren02')
        // "true" == t.reLogin && this.logOutFunc();
        // this.getUinfo(); // 顶部有获取
    },
    
    onShow: function() {
        console.log("geren");
        this.selectComponent("#header").setHeader(), s.isLogin() ? this.setData({
            showLogOutButton: !0
        }) : this.setData({
            showLogOutButton: !1
        });
    },
     
    getUinfo: function() {
        var e = this;
        wx.showLoading({
            title: "正在加载中..."
        });
        var t = s.getStorageSync(s.storageKey.openId);
        a.post1('/wechat/Member/getUserInfo', {
            openid: t
        }).then(function(t) {
            if (wx.hideLoading(), "1" == t.code) {
                var a = t.data, i = s.getStorageSync(s.storageKey.phoneNumber);
                // s.setStorageSync(s.storageKey.userBase, t.data);
                // s.setStorageSync(s.storageKey.uid,t.data.id);
                // s.setStorageSync(s.storageKey.phoneNumber, t.data.mobile);

                wx.setStorageSync('userBase', t.data);
                wx.setStorageSync('uid',t.data.id);
                wx.setStorageSync('phoneNumber', t.data.mobile);


                let img=getApp().globalData.baseImgUrl+ t.data.headimgurl;
                console.log(img);
                e.setData({avatarUrl:getApp().globalData.baseImgUrl+ t.data.headimgurl});  
                // this.setData({});
            } else (0, o.default)({
                message: t.msg,
                duration: 5e3
            });
        });
    },

 
    onShareAppMessage: function() {
        return {
            title: "我的",
            path: "/pages/index/index"
        };
    },
   
    
});